* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 顶部工具栏 */
.toolbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toolbar-center {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tool-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

#videoTitle {
    font-size: 1.3rem;
    color: #2c3e50;
    font-weight: 600;
}

#videoInfo {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    gap: 2rem;
    min-height: calc(100vh - 120px);
}

/* 播放列表面板 */
.playlist-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 300px;
    max-width: 300px;
    display: none;
    position: fixed;
    left: 0;
    top: 80px;
    bottom: 0;
    z-index: 900;
    overflow: hidden;
}

.playlist-panel.open {
    display: block;
}

.panel-header {
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-content {
    padding: 1rem;
    overflow-y: auto;
    height: calc(100% - 60px);
}

.playlist-item {
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-item:hover {
    background: #f8f9fa;
}

.playlist-item.active {
    background: rgba(52, 152, 219, 0.1);
    border-left: 4px solid #3498db;
}

.playlist-item-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-info p {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* 视频播放区域 */
.video-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.video-player {
    background: #000;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

#videoElement {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 自定义控制器 */
.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 1rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    position: relative;
    margin-bottom: 1rem;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: #3498db;
    border-radius: 3px;
    position: absolute;
    top: 0;
    left: 0;
}

.progress-handle {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

.controls-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left, .controls-center, .controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: background 0.3s ease;
    border-radius: 50%;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.volume-fill {
    height: 100%;
    background: white;
    border-radius: 2px;
    position: absolute;
    top: 0;
    left: 0;
}

/* 视频信息面板 */
.video-info-panel {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
}

.video-details h2 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.video-details p {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.video-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* 加载指示器和错误提示 */
.loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #ffebee;
    border: 1px solid #ef5350;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    color: #c62828;
}

.error-message button {
    background: #ef5350;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.3s ease;
}

.error-message button:hover {
    background: #d32f2f;
}

/* 无视频消息 */
.no-videos {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 2rem;
}

/* 设置面板 */
.settings-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.settings-panel.open {
    display: flex;
}

.settings-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.settings-content h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.setting-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.setting-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 设置面板按钮 */
#closeSettings {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    color: #2c3e50;
    width: 100%;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

#closeSettings:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .settings-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .setting-group {
        margin-bottom: 1rem;
    }
    
    .setting-group select {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    #closeSettings {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

#closeSettings {
    width: 100%;
    background: #3498db;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
    margin-top: 1rem;
}

#closeSettings:hover {
    background: #2980b9;
}

.no-videos h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-videos p {
    margin-bottom: 2rem;
    font-size: 1rem;
}

.back-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #2980b9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .toolbar-center {
        display: none;
    }
    
    .main-content {
        flex-direction: column;
        padding: 0 1rem;
    }
    
    .playlist-panel {
        width: 100%;
        max-width: 100%;
    }
    
    .video-container {
        padding: 1rem;
    }
    
    .controls-bottom {
        flex-direction: column;
        gap: 1rem;
    }
}